import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
const app = createApp(App)

// element plus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'

// 导入所有图标并进行全局注册
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 全部注册Vant组件
import Vant, { Lazyload } from 'vant'
import 'vant/lib/index.css'

// 全局注册所有组件
import EpDesignerCore from '../package/index'

app.use(ElementPlus, {
  locale: zhCn
})

app.use(Vant)
app.use(Lazyload, {
  lazyComponent: true
})

app.use(EpDesignerCore)

app.use(router).mount('#app')
